
'
' *  NHibernate 代码模版
' 

Imports System.Collections.Generic

Namespace NCS
	''' <summary>
	'''	
	''' </summary>
	<Serializable()> _
	Public Class weight

		#Region "构造方法"
		Public Sub New()
			m_id = 0
			m_time = DateTime.Now
			m_name = Nothing

			m_weightv = 0
		End Sub
		#End Region


		#Region "私有变量"
		Private m_id As Integer
		Private m_time As DateTime
		Private m_name As String
		Private m_weightv As Double

		#End Region


		#Region "公有属性"

		'''<summary>
		'''
		'''</summary>
		Public Overridable Property id() As Integer
			Get
				Return m_id
			End Get
			Set
				m_id = value
			End Set
		End Property

		'''<summary>
		'''
		'''</summary>
		Public Overridable Property time() As DateTime
			Get
				Return m_time
			End Get
			Set
				m_time = value
			End Set
		End Property

		'''<summary>
		'''
		'''</summary>
		Public Overridable Property name() As String
			Get
				Return m_name
			End Get
			Set
				m_name = value
			End Set
		End Property

		'''<summary>
		'''
		'''</summary>
		Public Overridable Property weightv() As Double
			Get
				Return m_weightv
			End Get
			Set
				m_weightv = value
			End Set
		End Property

		#End Region

		#Region "Rewrite Equals and HashCode"
		''' <summary>
		''' 
		''' </summary>
		Public Overloads Overrides Function Equals(obj As Object) As Boolean
			If Me Is obj Then
				Return True
			End If
			If (obj Is Nothing) OrElse (obj.[GetType]() IsNot [GetType]()) Then
				Return False
			End If
			Dim castObj As weight = DirectCast(obj, weight)
			Return (castObj IsNot Nothing) AndAlso (m_id = castObj.id)
		End Function
		''' <summary>
		''' 用唯一值实现GetHashCode
		''' </summary>
		Public Overloads Overrides Function GetHashCode() As Integer
			Dim hash As Integer = 57
			hash = 27 * hash * m_id.GetHashCode()
			Return hash
		End Function
		#End Region
	End Class
End Namespace
